import request from "../utils/request.js"

//系统配置
export function getSiteConf() {
	return request({
		url: "/index/getSiteConf",
	})
}

//获取位置
export function getLocationByPoint(data) {
	return request({
		url: "/common/getLocationByPoint",
		data
	})
}

export function hotGoods(data) {
	return request({
		url: "/index/hotGoods",
		data
	})
}

//首页产品
export function Home() {
	return request({
		url: "/index/Home",
	})
}


export function getKey(data) {
	return request({
		url: "/Open/getSessionKey",
		data
	})
}

export function UserInfo() {
	return request({
		url: "/user/UserInfo"
	})
}

//获取openid
export function getMpUserOpenid(data) {
	return request({
		url: "/Login/getMpUserOpenid",
		data
	})
}


//小程序授权登录
export function mpLogin(data) {
	return request({
		url: "/Login/mpLogin",
		method: "post",
		data
	})
}


// 列表
export function getCategory() {
	return request({
		url: "/goods/getCategory"
	})
}

// 商品列表
export function GoodsList(data) {
	return request({
		url: "/goods/GoodsList",
		data
	})
}
// 商品详情
export function GoodsDetail(data) {
	return request({
		url: "/goods/detail",
		data
	})
}

// 购物车数量
export function getCartSum() {
	return request({
		url: "/cart/getCartSum"
	})
}

// 提交订单
export function OrderFound(data) {
	return request({
		url: "/Order/OrderFound",
		data
	})
}

// 城市列表
export function CityList(data) {
	return request({
		url: "/User/CityList",
		data
	})
}

//新增地址
export function AddressAdd(data) {
	return request({
		url: "/User/addressAddEdit",
		method: 'post',
		data
	})
}

//地址列表
export function AddressList() {
	return request({
		url: "/User/AddressList",
	})
}

// 删除地址
export function AddressDelete(data) {
	return request({
		url: "/User/AddressDelete",
		method: 'post',
		data
	})
}

//设置默认地址
export function AddressDefault(data) {
	return request({
		url: "/User/AddressDefault",
		method: 'post',
		data
	})
}

// 公告列表
export function notice() {
	return request({
		url: "/index/notice"
	})
}

// 公告详情
export function NoticeDetail(data) {
	return request({
		url: "/index/noticeDetail",
		data
	})
}

// 素材
export function material() {
	return request({
		url: "/Notice/material"
	})
}

// 素材详情
export function Materialdetail(data) {
	return request({
		url: "/Notice/detail",
		data
	})
}

// 关于我们
export function About() {
	return request({
		url: "/Notice/About"
	})
}

// 订单列表
export function OrderList() {
	return request({
		url: "/Order/OrderList"
	})
}

// 提交订单
export function CreateOrder(data) {
	return request({
		url: "/Order/CreateOrder",
		method: 'post',
		data
	})
}

// 支付订单
export function OrderPay(data) {
	return request({
		url: "/Order/OrderPay",
		data
	})
}

//提交支付订单
export function OrderSub(data) {
	return request({
		url: "/Order/OrderPay",
		method: 'post',
		data
	})
}

//取消订单
export function CancelOrder(data) {
	return request({
		url: "/Order/CancelOrder",
		method: 'post',
		data
	})
}

// 提现
export function withdraw(data) {
	return request({
		url: "/finance/withdraw",
		method: 'post',
		data
	})
}
// 提现记录
export function UserWithdrawList() {
	return request({
		url: "/User/UserWithdraw"
	})
}


// 资金明细
export function finance(data) {
	return request({
		url: "/finance/finance",
		data
	})
}

// 转账
export function transfer(data) {
	return request({
		url: "/finance/transfer",
		method: 'post',
		data
	})
}

// 发送验证码
export function sendCode(data) {
	return request({
		url: "/common/sendCode",
		method: 'post',
		data
	})
}

// 注册
export function register(data) {
	return request({
		url: "/login/register",
		method: 'post',
		data
	})
}

// 登录
export function userLogin(data) {
	return request({
		url: "/login/userLogin",
		method: 'post',
		data
	})
}


// 修改登录密码
export function changePwd(data) {
	return request({
		url: "/user/changePwd",
		method: 'post',
		data
	})
}

// 修改资金密码
export function changePayPwd(data) {
	return request({
		url: "/user/changePayPwd",
		method: 'post',
		data
	})
}

// 收款方式资料
export function bank() {
	return request({
		url: "/finance/bank "
	})
}

// 添加编辑收款
export function addEditBank(data) {
	return request({
		url: "/finance/addEditBank ",
		method: 'post',
		data
	})
}



// 微信支付
export function wxPay(data) {
	return request({
		url: "/order/wxPay",
		method: 'post',
		data
	})
}

// 微信支付的配置
export function WxConfig(data) {
	return request({
		url: "/order/wxConfig",
		data
	})
}

// 修改昵称
export function changeNickName(data) {
	return request({
		url: "/user/changeNickName",
		method: 'put',
		data
	})
}
// 忘记密码
export function forget(data) {
	return request({
		url: "/login/forget",
		method: 'post',
		data
	})
}

// 商家自营
export function goodsStore(data) {
	return request({
		url: "/goods/goodsStore",
		data
	})
}

// 商家自营
export function goodsSystem(data) {
	return request({
		url: "/goods/goodsSystem",
		data
	})
}

// 搜索商品
export function searchGoods(data) {
	return request({
		url: "/goods/searchGoods",
		data
	})
}

// 推荐图
export function getTeamTree(data) {
	return request({
		url: "/user/getTeamTree",
		data
	})
}

//VIP专区公告
export function getNotice() {
	return request({
		url: "/index/notice",
	})
}

//公告详情
export function noticeDetail(data) {
	return request({
		url: "/index/noticeDetail",
		data
	})
}

// 辅助聊天查询
export function assistant(data) {
	return request({
		url: "/notice/assistant",
		method: 'post',
		data
	})
}

//获取城市树图
export function getArea(data) {
	return request({
		url: "/common/getArea",
		data
	})
}



/**获取政策协议
 * @param {Object} data
 */
export function getPolicy(data) {
	return request({
		url: "/index/getPolicy",
		data
	})
}

/**常用参数
 * @param {Object} data
 */
export function commonParam(data) {
	return request({
		url: "/common/commonParam",
		data
	})
}

/**商家menu
 * 
 */
export function getMenu() {
	return request({
		url: "/common/getMenu"
	})
}


/**反馈列表
 * @param {Object} data
 */
export function feedbackList(data) {
	return request({
		url: "/user/feedbackList",
		data
	})
}

/**反馈详情
 * @param {Object} data
 */
export function feedbackInfo(data) {
	return request({
		url: "/user/feedbackInfo",
		data
	})
}
/**反馈
 * @param {Object} data
 */
export function feedback(data) {
	return request({
		url: "/user/feedback",
		method: "post",
		data
	})
}

/**邀请码
 */
export function getMpQrcode() {
	return request({
		url: "/user/getMpQrcode"
	})
}